package cn.neo.support.iv.fresco.utils;

import android.support.annotation.NonNull;
import android.view.View;

/**
 * <b>Name:</b>视图工具<br>
 * <b>Author:</b> WK（wangkun@xjzhicheng.com)<br>
 * <b>Date:</b> 2017-01-09<br>
 * <b>Describe:</b> PLEASE TO FIXME...<br>
 * <b>Version:</b>V1.0<br>
 * <b>Revision History:</b><br>
 */
public class ViewUtil {

    /**
     * 设置View的宽和高一样
     *
     * @param view        View
     * @param intervalDip 外边距
     */
    public static int modifierWHSame(View view, @NonNull int intervalDip) {
        int size = modifierWHSame(view, intervalDip, 1);
        return size;
    }

    /**
     * 设置View的宽高一样（减去间隔，并等分）
     *
     * @param view           view
     * @param intervalDip    外边距(dip)
     * @param divisionNumber 几等分
     */
    public static int modifierWHSame(View view, int intervalDip, @NonNull int divisionNumber) {
        int size = DensityUtil.divisionSize4Width(view.getContext(), intervalDip, divisionNumber);
        return size;
    }
}
